package com.itheima.tlias84.dao.mapper;

import com.itheima.tlias84.service.vo.ReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {

    @Select("select gender name, count(gender) `value` from emp group by gender;")
    List<ReportVO> getGenderData();

    @Select("select job name, count(job) `value` from emp group by job order by job asc")
    List<ReportVO> getJobData();

    @Select("select degree name, count(degree) `value` from stu group by degree order by degree asc")
    List<ReportVO> getStuDegreeData();

    @Select("select c.name name, count(s.id) `value` from stu s left join clazz c on s.clazz_id = c.id group by s.clazz_id order by s.clazz_id asc")
    List<ReportVO> getStuCountData();
}
